package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.DynamicForwardRecordRequest;
import one.stand.request.GoodsForwardRecordRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 产品信息查询
 * @author Administrator
 */
@RestController
@RequestMapping("/record")
public class RecordController extends BaseController {

    /**
     * 添加商品转发记录
     *
     * @return
     */
    @PostMapping("addGoodsForwardRecord")
    public ResultModel<Integer> addGoodsForwardRecord(@RequestBody GoodsForwardRecordRequest request) {
        return recordService.addGoodsForwardRecord(request);
    }

    /**
     * 使商品转发记录有效
     *
     * @return
     */
    @PostMapping("validGoodsForwardRecord")
    public ResultModel<Boolean> validGoodsForwardRecord(@RequestBody GoodsForwardRecordRequest request) {
        return recordService.validGoodsForwardRecord(request);
    }

    /**
     * 添加文章转发记录
     *
     * @return
     */
    @PostMapping("addDynamicForwardRecord")
    public ResultModel<Boolean> addDynamicForwardRecord(@RequestBody DynamicForwardRecordRequest request) {
        return recordService.addDynamicForwardRecord(request);
    }
}
